<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>layout页面布局</title>
		<script type="text/javascript" src="../js/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../js/easyui/jquery.easyui.min.js"></script>
		<link id="easyuiTheme" rel="stylesheet" type="text/css" href="../js/easyui/themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../js/easyui/themes/icon.css">
		<script type="text/javascript" src="../js/easyui/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="../js/ztree/jquery.ztree.all-3.5.js"></script>
		<link rel="stylesheet" type="text/css" href="../js/ztree/zTreeStyle.css" />
		<script>
			$(function(){
				/*$("#czbkLink").click(function(){
					$("#mytabs").tabs('add',{
						title:'传智播客',
						content:'传智播客黑马程序员,专注教育20年',
						closable:true
					});
				});*/
				//开启简单的数据支持
				var setting = {
					data:{
						simpleData:{
							enable:true
						}
					},
					callback:{
						onClick : function(event, treeId, treeNode, clickFlag){
							var content='<div style="width:100%;height:100%;overflow:hidden;">'
								+ '<iframe src="'
								+ treeNode.page
								+ '" scrolling="auto" style="width:100%;height:100%;border:0;"></iframe></div>';
							if(treeNode.page != undefined && treeNode.page !=""){
								if($("#mytabs").tabs('exists',treeNode.name)){
									$("#mytabs").tabs('select',treeNode.name);
								}else{
									$("#mytabs").tabs('add',{
										title:treeNode.name,
										content:content,
										closable:true
									});
								}
							}
						}
					}
				};
				//编写树形菜单数据
				var zNodes=[
					{id:1,pId:0,name:"父节点一"},
					{id:2,pId:0,name:"父节点二"},
					{id:11,pId:1,name:"子节点11",page:"http://www.baidu.com"},
					{id:12,pId:1,name:"子节点12",page:"http://www.163.com"},
					{id:21,pId:2,name:"子节点21",page:"http://www.taobao.com"},
					{id:22,pId:2,name:"子节点22",page:"http://www.sina.com"}
				];
				//生成树形菜单
				$.fn.zTree.init($("#baseMenu"),setting,zNodes);
				
				//对选项卡注册右键事件
				$("#mytabs").tabs({
					onContextMenu:function(e,title,index){
						//阻止默认菜单显示
						e.preventDefault();
						//显示自定义右键菜单
						$("#mm").menu('show',{
							left : e.pageX,
							top : e.pageY
						});
					}
				});
			});
		</script>
	</head>
	<body class="easyui-layout">
		<div data-options="region:'north',title:'传智播客管理系统'" style="height: 100px;"></div>
		<div data-options="region:'west',title:'传智播客管理系统'" style="width: 180px">
			<div class="easyui-accordion" data-options="fit:true">
				<div data-options="title:'基础菜单'">
					<ul id="baseMenu" class="ztree"></ul>
				</div>
				<div data-options="title:'系统菜单'">面板2</div>
			</div>
		</div>
		<div data-options="region:'center'" style="width: 100px">
			<div class="easyui-tabs" data-options="fit:true" id="mytabs"></div>
		</div>
		<div data-options="region:'east'" style="width: 80px">东部区域</div>
		<div data-options="region:'south'" style="height: 80px">南部区域</div>
		<div id="mm" class="easyui-menu" style="width:120px;">
			<div>关闭当前窗口</div>
			<div>关闭其他窗口</div>
			<div class="menu-sep"></div> <!-- 分割线 -->
			<div data-options="iconCls:'icon-cancel'">关闭全部窗口</div>
		</div>
	</body>
</html>


















